﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HR60_PanelSoft.Tools
{
    class CollectionUtils
    {

        public static string getDictionaryOfFirstValue(IDictionary dic)
        {
           

            string first = "";
            if (dic == null)
                return first;

            KeyValuePair<string, object> kvp = ((Dictionary<string, object>)(dic)).FirstOrDefault();
            first = kvp.Value.ToString();
            return first;

        }

        public static object getFirst<T>(List<T> list)
        {

            if (list==null || list.Count == 0)
            return null;

            return list[0];
        }


        public static bool isBlank<T>(List<T> list)
        {

            if (list == null)
                return true;

            if (list.Count == 0)
                return true;

            return  false;
        }
    }
}
